package model;

import vinciappli.CardId;


public class Civilization {

    private Card caracteristic1;
    private Card caracteristic2;

    public Civilization(Card caracteristic1, Card caracteristic2) {
        this.caracteristic1 = caracteristic1;
        this.caracteristic2 = caracteristic2;
    }

    /**
     * Check if a civilization is composed of a specified card
     * @param c : Specified card
     * @return : true if the civilization is composed of the card, falseo otherwise
     */
    public boolean isComposedOf(CardId c)
    {
        if(caracteristic1.getType() == c || caracteristic2.getType() == c)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    /**
     * Calculation of the amount of troops given to the player who's selected the civilization
     * @return : Total amount of points
     */
    public int getInitialPts()
    {
        int pts = 0;
        pts += caracteristic1.getNbTroopsIni();
        pts += caracteristic2.getNbTroopsIni();
        if(caracteristic1.getType().equals(CardId.specialisation))
        {
            pts += caracteristic2.getNbTroopsIni() + 1;
        }
        if(caracteristic2.getType().equals(CardId.specialisation))
        {
            pts += caracteristic1.getNbTroopsIni() + 1;
        }
        return pts;
    }

    /***************************** GETTERS & SETTERS **************************/
    
    public Card getCaracteristic1 () {
        return caracteristic1;
    }

    public void setCaracteristic1 (Card val) {
        this.caracteristic1 = val;
    }

    public Card getCaracteristic2 () {
        return caracteristic2;
    }

    public void setCaracteristic2 (Card val) {
        this.caracteristic2 = val;
    }
}

